using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using RecruitmentSystem.Business;
using RecruitmentSystem.Common;
using System.Collections.Generic;

public partial class StudentManagement_RequestJobList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindDataList();
        }
    }

    private void BindDataList()
    {
        JobManager jm = new JobManager();
        AccountManager am = new AccountManager();
        int userid = am.GetUserId(User.Identity.Name, UserType.PersonalUser);
        List<JobPosition> jobs = new List<JobPosition>();
        AspNetPager1.RecordCount = jm.GetAllJobsById(userid, UserType.PersonalUser, PositionStatus.Activity);
        jobs = jm.GetJobsById(userid, UserType.PersonalUser, PositionStatus.Activity, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex);
        DataList1.DataSource = jobs;
        DataList1.DataBind();
    }

    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        BindDataList();
    }
}
